home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_300 / 300_01 / bolt.doc < prev    next >
Text File  |  1989-12-28  |  4KB  |  98 lines

  1.  
  2.  
  3.                     DOCUMENTATION FOR BOLT.C
  4.  
  5.  
  6. PURPOSE:  To demonstrate a simple MAT_LIB application program.  The 
  7. program is very short but that is one of the greatest strengths of 
  8. MAT_LIB. Relatively powerful programs can be written quickly. This 
  9. program is not intended for professional use. Bolt stress is 
  10. calculated by dividing the applied load by the net root area. The 
  11. program should be examinined only as an illustration of how to use the 
  12. MAT_LIB functions. 
  13.  
  14. REFERENCE:  None.
  15.  
  16. GENERAL PROGRAM DESCRIPTION: The user prepares an ASCII text file 
  17. contaning the bolt loads, bolt diameters, and the number of bolt threads 
  18. per inch. The root area at the base of the threads is computed first and 
  19. then the load is divided by the calculated area to determine the bolt 
  20. stress. The bolt stress and key input parameters are then directed to 
  21. an output file. Comments (such as the column headings) may be included 
  22. in the input textfile as long as they are enclosed in curly braces. 
  23.  
  24. Here is an example input file named <INPUT.INP>
  25.  
  26. {
  27. Sample         Tension     Bolt           Threads
  28. Identifier     Load        Diameter       Per
  29.                (lbs)       (in)           Inch
  30. }
  31. A              1000        0.375          16
  32. B              3000        0.500          13
  33. C              5000        0.625          11
  34. D              9000        0.750          10
  35.  
  36.  
  37. The following file is output:
  38.  
  39. {
  40. BOLT.OUT  6/1/1989
  41. }
  42. {
  43.                  Sample             Area(sq_in)       Stress(lbs/sq_in) 
  44. }
  45.                       A                  0.0496              20180.3613 
  46.                       B                  0.1214              24710.9141 
  47.                       C                  0.2182              22912.2207 
  48.                       D                  0.3444              26135.6309 
  49.  
  50.  
  51.  
  52. USER INTERFACE DESCRIPTION:  After creating the input file "BOLT.INP, the 
  53. program is executed by entering "BOLT". The program will execute, 
  54. calculate the bolt stresses, store the results in BOLT.OUT, and exit to 
  55. the operating system.  Notice that if a line of data is added the program 
  56. will automatically evaluate it and include the results in the output 
  57. file. 
  58.  
  59. A. INPUT FILE DESCRIPTION: The ASCII file to be read by BOLT.EXE can 
  60. be typed up using a separate text editor. The file must be arranged as 
  61. follows:
  62.  
  63.  
  64. Data                                                             
  65. Line No.    Data Description                                                     
  66. ---------   -------------------------------------------------------------
  67.  
  68. 1           Mark number, tensioin load, bolt diameter, and pitch separated 
  69. .. to ..    by spaces or tabs.
  70. number of
  71. bolts
  72.  
  73.  
  74. NOTE: Lines containing only comments or which are blank 
  75.       are not counted.
  76.                                   
  77.  
  78. PROGRAM LIMITATIONS:  This program is not universally applicable to all 
  79. situations encountered. The input file must be named "BOLT.INP" and the 
  80. output is always directed to the file named "BOLT.OUT". The MAT_LIB 
  81. boundary checking (tck) macro is not used to make sure no calls are made 
  82. outside the dynamic text arrays. It is always a good idea to use it at 
  83. least for debugging.
  84.  
  85.  
  86. VARIABLE DESCRIPTIONS:
  87.  
  88. rows                   : Number of data rows
  89. cols                   : Number of columns in the input file
  90. toksz                  : Number of characters in the largest input
  91.                          file token
  92. *FN                    : The output file identifier
  93. *inp                   : Input data text array
  94. *out                   : Output data text array
  95. Net_Area               : Bolts root area
  96. Stress                 : Calculated bolt stress
  97.  
  98.